1. Field of the Invention
The present invention relates to a coding method, code converting method and apparatus, and image forming apparatus and, more particularly, to a coding method, code converting method and apparatus, and image forming apparatus capable of high-speed conversion of data coded by different coding methods.
2. Description of the Related Art
In data communication, data is generally compressed before transmission and expanded on a receiving side in order to increase the efficiency of communication. Also, data is often compressed before storage to efficiently use the capacity of a storage medium. Especially in image communication which handles large amounts of data, data compression is an important subject, so various systems have been studied and employed.
In facsimile apparatuses as one type of image forming apparatuses, MH coding, MR-coding, and MMR coding recommended by T.4 and T.6 of ITU-T have been used as image data electrical transmission coding methods. These coding methods are kinds of an entropy coding method using binary run-length information. Therefore, in encoding MH codes, MR codes, and MMR codes, run-length data representing the continuations of black and white pixels by numerical values is usually formed as intermediate data, and this data is encoded under various conditions. Likewise, in data decoding, original image data is obtained through run-length data.
Recently, a JBIG coding method is recommended by T.85 of ITU-T as a high-efficiency binary data coding method replacing the conventional MH coding, MR coding, and MMR coding, and is beginning to be used as an electric transmission code in facsimile apparatuses. This JBIG coding defines two different coding methods: sequential coding and progressive coding. Facsimile apparatuses use ITU-T T.85 recommendation that is extended from the sequential method recommended by T.82 of ITU-T so as to be able to handle data which is unknown in the longitudinal direction.
The JBIG coding predicts whether a pixel to be encoded is white or black, from surrounding pixels (template) of the pixel to be encoded, and performs coding (arithmetic coding) on the basis of the probability of this prediction. The JBIG coding is much more efficient than the conventional MH coding, MR coding, and MMR coding. However, it is necessary to form a context from surrounding pixels and update a context table for each processing. This complicates the processes and requires large resources for coding.
The JBIG coding employs TP (Typical Prediction) to reduce the processes required for coding. Practical processing is as follows. In the sequential JBIG coding method used in facsimile apparatuses, whether one-line data to be presently encoded is the same as data of the preceding line is checked. If the two data are the same, it is determined that TP (Typical Prediction) from the data of the preceding line is possible, and a flag indicating this information is set so as not to encode the data of the present line to be encoded.
In either case, however, the JBIG coding is not a run-length coding method such as the MH coding, MR coding, or MMR coding. Therefore, to perform code conversion between JBIG codes and MH, MR, and MMR codes, it is conventionally necessary to once convert (decode) all coded data into raw image data and perform desired coding.
As described above, to convert into JBIG codes using no run length from MH, MR, and MMR codes using run length, or from MH, MR, and MMR codes accompanying non-compression, the codes must be once converted into an uncompressed raw image by decoding. This makes high-speed code conversion difficult.
For example, when image data are stored using run-length codes such as MH codes and are transmitted using JBIG codes in an image forming apparatus such as a facsimile apparatus, these codes must be converted in both transmission and reception; the stored codes must be converted into JBIG in transmission, and JBIG must be converted into the stored codes in reception. Accordingly, high-speed code conversion is essential to improve the overall throughput.
The present invention has been made in consideration of the above prior art, and has as its object to provide high-speed methods and apparatuses of encoding, decoding, and code conversion, and an image forming apparatus using these methods and apparatuses.
One aspect of the present invention lies in a coding method of coding input data by using typical prediction, characterized in that the input data is coded by a coding method different from a coding method using the typical prediction, and the typical prediction is performed by using the coded data.
Another aspect of the present invention lies in a coding method of coding input data by using typical prediction, characterized in that the input data is coded by a coding method different from a coding method using the typical prediction, and the typical prediction is performed by using the input data if an amount of the coded data is smaller than an amount of data to be coded by the different coding method, and by using the data to be coded by the different coding method if not.
Still another aspect of the present invention lies in a code converting method of converting first coded data coded by a first coding method using typical prediction into second coded data coded by a second coding method different from the first coding method, characterized by comprising the step of converting a portion of the first coded data, which is found to be typically unpredictable by the typical prediction, into intermediate data of the second coding method.
Still another aspect of the present invention lies in a code converting method of converting first coded data formed by coding original data by a first coding method into second coded data coded by a second coding method, characterized by comprising the conversion step of converting the first coded data into intermediate data between the first coded data and the original data, the prediction step of performing typical prediction by using a predetermined unit of the intermediate data and obtaining a prediction result, and the encoding/decoding step of encoding the intermediate data into the second coded data if the prediction result indicates that the typical prediction is possible, and decoding the intermediate data into the original data and performing the second coding if the prediction result indicates that the typical prediction is impossible.
Still another aspect of the present invention lies in a code conversion method of converting first coded data formed by coding original data by a first coding method into second coded data coded by a second coding method, characterized in that the second coding is performed by using intermediate data generated in a course of performing the first coding method.
Still another aspect of the present invention lies in a coding apparatus comprising typical predicting means for performing typical prediction for input data, and coding means for performing a predetermined coding method using the typical prediction, characterized in that the input data is coded by a coding method different from the predetermined coding method.
Still another aspect of the present invention lies in a code converting apparatus for converting first coded data coded by a first coding method using typical prediction into second coded data coded by a second coding method different from the first coding method, characterized by comprising detecting means for detecting, from the first coded data, a portion found to be typically unpredictable by the typical prediction, and converting means for converting the detected portion into intermediate data in the second coding method.
Still another aspect of the present invention lies in a code converting apparatus for converting first coded data formed by coding original data by a first coding method into second coded data coded by a second coding method, characterized by comprising converting means for converting the first coded data into intermediate data between the first coded data and the original data, predicting means for performing typical prediction for each predetermined unit of the intermediate data and outputting a prediction result, and encoding/decoding means for encoding a predetermined range of the intermediate data found to be typically predictable by the prediction result, and decoding a predetermined range found to be typically unpredictable into the original data and encoding the original data into the second coded data.
Still another aspect of the present invention lies in an image forming apparatus for coding and outputting image data, characterized by comprising image data input means, first encoding means for encoding the image data by a first coding method and saving the data as first coded data, decoding means for decoding the first coded data into intermediate coded data generated in a course of encoding by the first coding method, and second encoding means for encoding the intermediate coded data by a second coding method different from the first coding method and outputting the data as second coded data.
Still another aspect of the present invention lies in a coding apparatus for coding input data by using typical prediction, characterized by comprising predicting means for performing the typical prediction, coding means for coding the input data on the basis of a prediction result from the predicting means, wherein the input data is coded by a coding method different from the coding method using the typical prediction, and the predicting means performs the typical prediction by directly using the input data.
Still another aspect of the present invention lies in a coding apparatus for coding input data by using typical prediction, characterized in that the input data is coded by a coding method different from a coding method using the typical prediction, the apparatus comprises predicting means for performing the typical prediction, coding means for coding the input data on the basis of a prediction result from the predicting means, and original data amount detecting means for detecting an amount of original data before the input data is coded by the different coding method, and the predicting means performs the typical prediction by directly using the input data if the amount of the original data is smaller than an amount of the input data, and performs the typical prediction by using the original data if not.
Still another aspect of the present invention lies in a coding apparatus for converting first coded data coded by a first coding method using typical prediction into second coded data coded by a second coding method different from the first coding method, characterized by comprising detecting means for detecting, from the first coded data, a portion found to be typically unpredictable by the typical prediction, and data converting means for converting the portion found to be typically unpredictable into intermediate data of the second coding method.
Still another aspect of the present invention lies in a coding apparatus for converting first coded data formed by coding original data by a first coding method into second coded data coded by a second coding method, characterized by comprising converting means for converting the first coded data into intermediate data between the first coded data and the original data, predicting means for performing typical prediction using a predetermined unit of the intermediate data and obtaining a prediction result, and encoding/decoding means for encoding the intermediate data into the second coded data if the prediction result indicates that the typical prediction is possible, and decoding the intermediate data into the original data and performing the second coding if the prediction result indicates that the typical prediction is impossible.
Still another aspect of the present invention lies in a coding apparatus for converting first coded date formed by coding original data by a first coding method into second coded data coded by a second coding method, characterized by comprising decoding means for decoding the first coded data into intermediate data generated in a course of performing the first coding method, and encoding means for performing the second coding by using the intermediate data.
Still another aspect of the present invention lies in a computer readable storage medium storing a control program of an image forming apparatus for coding and outputting image data, characterized by comprising a program of the image data input step, a program of the first encoding step of encoding the image data by a first coding method and saving the data as first coded data, a program of the decoding step of decoding the first coded data into intermediate coded data generated in a course of encoding by the first coding method, and a program of the second encoding step of encoding the intermediate coded data by a second coding method different from the first coding method and outputting the data as second coded data.
Still another aspect of the present invention lies in a computer readable storage medium storing a control program of a coding apparatus for coding input data by using typical prediction, characterized by comprising a program of the prediction step of performing the typical prediction, and a program of the coding step of coding the input data on the basis of a prediction result in the prediction step, wherein the input data is coded by a coding method different from the coding method using the typical prediction, and the prediction step comprises performing the typical prediction by directly using the input data.
Still another aspect of the present invention lies in a computer readable storage medium storing a control program of a coding apparatus for coding input data by using typical prediction, characterized in that the input data is coded by a coding method different from a coding method using the typical prediction, the storage medium comprises a program of the prediction step of performing the typical prediction, a program of the coding step of coding the input data on the basis of a prediction result in the predicting step, and a program of the original data amount detection step of detecting an amount of original data before the input data is coded by the different coding method, and the prediction step comprises performing the typical prediction by directly using the input data if the amount of the original data is smaller than an amount of the input data, and performs the typical prediction by using the original data if not.
Still another aspect of the present invention lies in a computer readable storage medium storing a control program of a coding apparatus for converting first coded data coded by a first coding method using typical prediction into second coded data coded by a second coding method different from the first coding method, characterized by comprising a program of the detection step of detecting, from the first coded data, a portion found to be typically unpredictable by the typical prediction, and a program of the data conversion step of converting the portion found to be typically unpredictable into intermediate data of the second coding method.
Still another aspect of the present invention lies in a computer readable storage medium storing a program code of a coding apparatus for converting first coded data formed by coding original data by a first coding method into second coded data coded by a second coding method, characterized by comprising a program of the conversion step of converting the first coded data into intermediate data between the first coded data and the original data, a program of the prediction step of performing typical prediction using a predetermined unit of the intermediate data and obtaining a prediction result, and a program of the encoding/decoding step of encoding the intermediate data into: the second coded data if the prediction result indicates that the typical prediction is possible, and decoding the intermediate data into the original data and performing the second coding if the prediction result indicates that the typical prediction is impossible.
Still another aspect of the present invention lies in a computer readable storage medium storing a control program of a coding apparatus for converting first coded data formed by coding original data by a first coding method into second coded data coded by a second coding method, characterized by comprising a program of the decoding step of decoding the first coded data into intermediate data generated in a course of performing the first coding method, and a program of the encoding step of performing the second coding by using the intermediate data.
Other features and advantages of the present invention will be apparent from the following description taken in conjunction with the accompanying drawings, in which like reference characters designate the same or similar parts throughout the figures thereof.